﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using EF.Model.Base;
using EF.Model;
using EF.Util.DBUtility;
using EF.Util;
using EF.DAL.Base;

/// <summary>
/// Copyright (C) 2010 峰予信息科技有限公司 
/// 版权所有
///  
/// 文件名：         ArgService
/// 文件功能描述：   参数表新建,编辑,查看
/// 　
/// 创建标识：       darkross.zhou20100511 
/// 
/// </summary>
namespace EF.BLL.Base
{
    public class ArgService
    {
        private ArgDAO argDAL = new ArgDAO();

        /// <summary>
        /// 根据参数类型获取参数
        /// </summary>
        /// <param name="argtype">参数类型</param>
        /// <param name="lang">语言</param>
        /// <returns></returns>
        public DataTable GetArg(string argtype, string lang)
        {
            return argDAL.GetArg(argtype, lang);
        }

        /// <summary>
        /// 获取ArgType列表
        /// </summary>
        /// <param name="lang">语言标识</param>
        /// <param name="columns">返回列头</param>
        /// <param name="pageIndex">翻页</param>
        /// <param name="pageSize">每页记录行数</param>
        /// <param name="orderBy">排序字段</param>
        /// <param name="rowsCount">记录总数</param>
        /// <returns></returns>
        public DataTable GetArgTypeList(string lang,string columns,int? pageIndex,int? pageSize,string orderBy, out int rowsCount)
        {
            return argDAL.GetArgTypeList(lang,columns ,pageIndex,pageSize,orderBy ,out rowsCount);
        }

        /// <summary>
        /// 获取Arg列表
        /// </summary>
        /// <param name="lang">语言标识</param>
        /// <param name="columns">返回列头</param>
        /// <param name="pageIndex">翻页</param>
        /// <param name="pageSize">每页记录行数</param>
        /// <param name="orderBy">排序字段</param>
        /// <param name="rowsCount">记录总数</param>
        /// <returns></returns>
        public DataTable GetArgList(string lang, string columns, int? pageIndex, int? pageSize, string orderBy, out int rowsCount, string sel_argtype_id)
        {
            return argDAL.GetArgList(lang, columns, pageIndex, pageSize, orderBy, out rowsCount, sel_argtype_id);
        }

        /// <summary>
        /// ArgType新建
        /// </summary>
        /// <param name="model">参数类型Model</param>
        /// <returns>1,新建成功;2,新建失败,参数标识已存在;0,新建失败,数据库异常.</returns>
        public int Add(ArgTypeModel model, string lang, out string msg)
        {
            return argDAL.Add(model, lang, out msg);
        }

        /// <summary>
        /// 获取ArgTypeModel
        /// </summary>
        /// <param name="lang">语言</param>
        /// <param name="userId">用户Id</param>
        /// <returns></returns>
        public ArgTypeModel GetModel(string lang, int argtypeId)
        {
            return argDAL.GetModel(lang, argtypeId);
        }

        /// <summary>
        /// ArgType编辑
        /// </summary>
        /// <param name="model">ArgTypeModel</param>
        /// <returns>1,编辑成功;0,编辑失败,数据库异常.</returns>
        public int Edit(ArgTypeModel model, string lang, out string msg)
        {
            return argDAL.Edit(model, lang, out msg);
        }

        /// <summary>
        /// 用户逻辑删除
        /// </summary>
        /// <param name="userId">被逻辑删除用户Id</param>
        /// <param name="updateUser">执行逻辑删除用户Id</param>
        /// <returns>1,逻辑删除成功;0,逻辑删除失败,数据库异常.</returns>
        public int LogicDel(string selArgTypeIds, int updateUser, string lang, out string msg)
        {
            return argDAL.LogicDel(selArgTypeIds, updateUser, lang, out msg);
        }
    }
}
